Replicating test case data into a cache with non-naturally aligned data boundaries

ABSTRACT

Data is replicated into a memory cache with non-naturally aligned data boundaries to reduce the time needed to generate test cases for testing a processor. Placing data in the non-naturally aligned data boundaries as described herein allows replicated testing of the memory cache while preserving double word and quad word boundaries in segments of the replicated test data. This allows test cases to be generated for a section of memory and then replicated throughout the memory and tested by a single test branching back and using the next strand of the replicated test data in the memory cache.

BACKGROUND

1. Technical Field

This disclosure generally relates to computer hardware testing anddevelopment, and more specifically relates to a system and method forreplicating test data into memory cache with non-naturally aligned databoundaries while preserving sub-segments with aligned boundaries in thesegments of the replicated test data.

2. Background Art

Processor testing tools exist whose goal is to generate the moststressful test case for a processor. In theory, the generated test caseshould provide maximum test coverage and should be able to stressvarious timing scenarios on the processor, including the memory.Building test cases can be extremely costly in time and resources suchthat building efficient test cases is an important part of processortesting.

Many processors have restrictions on alignment for memory operations.For example, some power processors allow different alignment boundariesin memory for different instructions while in different modes like CacheInhibited, Little Endian etc. With these complexities on boundaryrestrictions, it's very difficult to generate test cases for thedifferent alignment boundaries for each of the instructions. Moreover,testing all valid boundaries for an instruction is very important andmultiple test cases for multiple boundaries would have the overhead ofgeneration and simulation in case of reference model checking. Prior arttest case generation was extremely labor intensive to test the differentalignment boundaries while preserving boundaries where needed.

BRIEF SUMMARY

Data is replicated into a memory cache with non-naturally aligned databoundaries to reduce the time needed to generate test cases for testinga processor. Placing data in the non-naturally aligned data boundariesas described herein allows replicated testing of the memory cache whilepreserving double word and quad word boundaries in segments of thereplicated test data. This allows test cases to be generated for asection of memory and then replicated throughout the memory and testedby a single test branching back and using the next slice of thereplicated test data in the memory cache.

The foregoing and other features and advantages will be apparent fromthe following more particular description, as illustrated in theaccompanying drawings.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWING(S)

The disclosure will be described in conjunction with the appendeddrawings, where like designations denote like elements, and:

FIG. 1 is a block diagram a computer system with a test case generatoras described herein to generate test data in a data cache withnon-naturally aligned data boundaries;

FIG. 2 is a simplified block diagram of a system for testing data in adata cache with non-naturally aligned data boundaries;

FIG. 3 is a simplified example of a test case branching back and usingsuccessive slices of replicated test data with non-naturally aligneddata boundaries;

FIG. 4 illustrates successive slices of replicated test data withnon-naturally aligned data boundaries stored in a memory cache;

FIG. 5 further illustrates the data in FIG. 4 having non-naturallyaligned data boundaries;

FIG. 6 is a flow diagram of a method for reducing the time needed togenerate test cases for testing a processor by replicating test data andplacing slices of the test data into a memory cache where the slices ofthe replicated test data have non-naturally aligned data boundaries; and

FIG. 7 is a flow diagram of a specific method for step 630 in FIG. 6.

DETAILED DESCRIPTION

The disclosure and claims herein relate to a system and method forreplicating test data into a memory cache with non-naturally aligneddata boundaries to reduce the time needed to generate test cases fortesting a processor. Placing data in the non-naturally aligned databoundaries as described herein allows replicated testing of the memorycache while preserving double word and quad word boundaries in segmentsof the replicated test data. This allows test cases to be generated fora section of memory and then replicated throughout the memory and testedby a single test branching back and using the next slice of thereplicated test data in the memory cache.

Referring to FIG. 1, a computer system 100 is one suitableimplementation of a computer system that is capable of performing thecomputer operations described herein including a test case generator forgenerating test cases for verifying and validating a processor designand/or a test case executor as described herein. Computer system 100 isa computer which can run multiple operating systems including the IBM ioperating system. However, those skilled in the art will appreciate thatthe disclosure herein applies equally to any computer system, regardlessof whether the computer system is a complicated multi-user computingapparatus, a single user workstation, laptop, phone or an embeddedcontrol system. As shown in FIG. 1, computer system 100 comprises one ormore processors 110. The processor 110 may contain a branch trackingunit 112 as described further below. The computer system 100 furtherincludes a main memory 120, a mass storage interface 130, a displayinterface 140, and a network interface 150. These system components areinterconnected through the use of a system bus 160. Mass storageinterface 130 is used to connect mass storage devices with a computerreadable medium, such as direct access storage devices 155, to computersystem 100. One specific type of direct access storage device 155 is areadable and writable CD-RW drive, which may store data to and read datafrom a CD-RW 195. Some devices may have a removable memory card orsimilar for a direct access storage device 155 instead of the CD-RWdrive.

Main memory 120 preferably contains an operating system 121. Operatingsystem 121 is a multitasking operating system known in the industry asIBM i; however, those skilled in the art will appreciate that the spiritand scope of this disclosure is not limited to any one operating system.The memory 120 further includes data 122 and a test case generator 123.The memory 120 also includes test code 124 and test data 125 which istypically created by the test case generator 123.

Computer system 100 utilizes well known virtual addressing mechanismsthat allow the programs of computer system 100 to behave as if they onlyhave access to a large, single storage entity instead of access tomultiple, smaller storage entities such as main memory 120 and DASDdevice 155. Therefore, while operating system 121, data 122, test casegenerator 123, test code 124 and test data 124 are shown to reside inmain memory 120, those skilled in the art will recognize that theseitems are not necessarily all completely contained in main memory 120 atthe same time. It should also be noted that the term “memory” is usedherein generically to refer to the entire virtual memory of computersystem 100, and may include the virtual memory of other computer systemscoupled to computer system 100.

Processor 110 may be constructed from one or more microprocessors and/orintegrated circuits. Processor 110 executes program instructions storedin main memory 120. Main memory 120 stores programs and data thatprocessor 110 may access. When computer system 100 starts up, processor110 initially executes the program instructions that make up operatingsystem 121 and later executes the program instructions that make up thetest case generator 123 to generate the test code and the test data asdirected by a user.

Although computer system 100 is shown to contain only a single processorand a single system bus, those skilled in the art will appreciate thatthe system may be practiced using a computer system that has multipleprocessors and/or multiple buses. In addition, the interfaces that areused preferably each include separate, fully programmed microprocessorsthat are used to off-load compute-intensive processing from processor110. However, those skilled in the art will appreciate that thesefunctions may be performed using I/O adapters as well.

Display interface 140 is used to directly connect one or more displays165 to computer system 100. These displays 165, which may benon-intelligent (i.e., dumb) terminals or fully programmableworkstations, are used to provide system administrators and users theability to communicate with computer system 100. Note, however, thatwhile display interface 140 is provided to support communication withone or more displays 165, computer system 100 does not necessarilyrequire a display 165, because all needed interaction with users andother processes may occur via network interface 150, e.g. web clientbased users.

Network interface 150 is used to connect computer system 100 to othercomputer systems or workstations 175 via network 170. Network interface150 broadly represents any suitable way to interconnect electronicdevices, regardless of whether the network 170 comprises present-dayanalog and/or digital techniques or via some networking mechanism of thefuture. In addition, many different network protocols can be used toimplement a network. These protocols are specialized computer programsthat allow computers to communicate across a network. TCP/IP(Transmission Control Protocol/Internet Protocol) is an example of asuitable network protocol.

The present invention may be a system, a method, and/or a computerprogram product at any possible technical detail level of integration.The computer program product may include a computer readable storagemedium (or media) having computer readable program instructions thereonfor causing a processor to carry out aspects of the present invention.

The computer readable storage medium can be a tangible device that canretain and store instructions for use by an instruction executiondevice. The computer readable storage medium may be, for example, but isnot limited to, an electronic storage device, a magnetic storage device,an optical storage device, an electromagnetic storage device, asemiconductor storage device, or any suitable combination of theforegoing. A non-exhaustive list of more specific examples of thecomputer readable storage medium includes the following: a portablecomputer diskette, a hard disk, a random access memory (RAM), aread-only memory (ROM), an erasable programmable read-only memory (EPROMor Flash memory), a static random access memory (SRAM), a portablecompact disc read-only memory (CD-ROM), a digital versatile disk (DVD),a memory stick, a floppy disk, a mechanically encoded device such aspunch-cards or raised structures in a groove having instructionsrecorded thereon, and any suitable combination of the foregoing. Acomputer readable storage medium, as used herein, is not to be construedas being transitory signals per se, such as radio waves or other freelypropagating electromagnetic waves, electromagnetic waves propagatingthrough a waveguide or other transmission media (e.g., light pulsespassing through a fiber-optic cable), or electrical signals transmittedthrough a wire.

Computer readable program instructions described herein can bedownloaded to respective computing/processing devices from a computerreadable storage medium or to an external computer or external storagedevice via a network, for example, the Internet, a local area network, awide area network and/or a wireless network. The network may comprisecopper transmission cables, optical transmission fibers, wirelesstransmission, routers, firewalls, switches, gateway computers and/oredge servers. A network adapter card or network interface in eachcomputing/processing device receives computer readable programinstructions from the network and forwards the computer readable programinstructions for storage in a computer readable storage medium withinthe respective computing/processing device.

Computer readable program instructions for carrying out operations ofthe present invention may be assembler instructions,instruction-set-architecture (ISA) instructions, machine instructions,machine dependent instructions, microcode, firmware instructions,state-setting data, configuration data for integrated circuitry, oreither source code or object code written in any combination of one ormore programming languages, including an object oriented programminglanguage such as Smalltalk, C++, or the like, and procedural programminglanguages, such as the “C” programming language or similar programminglanguages. The computer readable program instructions may executeentirely on the user's computer, partly on the user's computer, as astand-alone software package, partly on the user's computer and partlyon a remote computer or entirely on the remote computer or server. Inthe latter scenario, the remote computer may be connected to the user'scomputer through any type of network, including a local area network(LAN) or a wide area network (WAN), or the connection may be made to anexternal computer (for example, through the Internet using an InternetService Provider). In some embodiments, electronic circuitry including,for example, programmable logic circuitry, field-programmable gatearrays (FPGA), or programmable logic arrays (PLA) may execute thecomputer readable program instructions by utilizing state information ofthe computer readable program instructions to personalize the electroniccircuitry, in order to perform aspects of the present invention.

Aspects of the present invention are described herein with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems), and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer readable program instructions.

These computer readable program instructions may be provided to aprocessor of a general purpose computer, special purpose computer, orother programmable data processing apparatus to produce a machine, suchthat the instructions, which execute via the processor of the computeror other programmable data processing apparatus, create means forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks. These computer readable program instructionsmay also be stored in a computer readable storage medium that can directa computer, a programmable data processing apparatus, and/or otherdevices to function in a particular manner, such that the computerreadable storage medium having instructions stored therein comprises anarticle of manufacture including instructions which implement aspects ofthe function/act specified in the flowchart and/or block diagram blockor blocks.

The computer readable program instructions may also be loaded onto acomputer, other programmable data processing apparatus, or other deviceto cause a series of operational steps to be performed on the computer,other programmable apparatus or other device to produce a computerimplemented process, such that the instructions which execute on thecomputer, other programmable apparatus, or other device implement thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods, and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof instructions, which comprises one or more executable instructions forimplementing the specified logical function(s). In some alternativeimplementations, the functions noted in the blocks may occur out of theorder noted in the Figures. For example, two blocks shown in successionmay, in fact, be executed substantially concurrently, or the blocks maysometimes be executed in the reverse order, depending upon thefunctionality involved. It will also be noted that each block of theblock diagrams and/or flowchart illustration, and combinations of blocksin the block diagrams and/or flowchart illustration, can be implementedby special purpose hardware-based systems that perform the specifiedfunctions or acts or carry out combinations of special purpose hardwareand computer instructions.

FIG. 2 illustrates a simplified block diagram of a system 200 forreducing the time needed to generate test cases for testing a processorby replicating test data and placing slices of the test data into amemory cache where the slices of the replicated test data havenon-naturally aligned data boundaries. A user 210 or an operator usesthe test case generator 123 to provide tests cases 212 to a test caseexecutor 214. The test case generator 123 and the test case executor 214operate in a manner similar to the prior art except as described herein.The test cases 212 include test code 124 and test data 125. The testcase executor 214 loads the test code 124 into a processor 216 to verifyand validate the processor design. The test code 124 uses a base offsetaddress 220 to access the test data as described further below. The testcase executor 214 further loads the test data 125 into a cache 218 ofthe processor 216. The test case executor 214 replicates the test data125, placing multiple slices of the test data into the cache asdescribed further below.

FIG. 3 is a simplified example of test code branching back and usingsuccessive slices of replicated test data with non-naturally aligneddata boundaries. The test case executor 214 loads the test code 124 intoa memory associated with the processor 216 to verify and validate theprocessor design. The test case executor 214 further loads the test data125 into a cache 218 of the processor 216. In the illustrated example,the test data 125 is loaded into three consecutive slices of memory.Test data slice0 125A is loaded first, followed by test data slice1 125Band test data slice2 125C. As would be understood by one of ordinaryskill in the art, additional slices could be loaded into memory; howeveronly three test data slices are shown here for illustration purposes. Incontrast to the prior art, the cache 218 can be loaded with replicatedslices of the test data as described in more detail below to greatlysimplify test case generation.

Again referring to FIG. 3, the test code 124 is run a first time 310using the base offset 220 to run test cases using the test data slice0125A. The base offset 220 is an address pointer used by the test code124 to address the test data 125 and initially points to the test dataslice0 125A. The test code 124 runs a second time 312 using the baseoffset 220 plus the size of the test data slice to run test cases usingthe test second test data slice1 125B. Similarly, the test code 124 runsa third time 314 using the base offset 220 plus two times the size ofthe test data slice to run test cases using the third test data slice2125C. In a similar manner, the test data 124 can be run multiple timesto test each replication of the test data 125 stored in the cache 218.

FIG. 4 illustrates additional detail of successive slices of replicatedtest data with non-naturally aligned data boundaries. FIG. 4 representsa simplified representation of a portion of the memory cache 218introduced above. In the illustrated example, the cache 218 illustratesfour replicated slices 410 of test data (described further below). Thetable 412 above the cache data illustrates how the data in the cache isdivided. A line of data in the cache is divided into eight quad words414. The quad words 414 are labeled QW0 through QW7. Each quad word 414is divided into two double words 416. The double words for each quadword are labeled DW0 and DW1. Each double word 416 is further dividedinto two words 416 (not labeled). In this example, each word is fourbytes of data. Thus each cache line of data having eight quad words is128 bytes of data. Thus the cache 218 is divided into lines of data 420with 128 bytes in each line. In the illustrated portion of cache 218shown in FIG. 4, lines 1-9 and 27-35 are shown with the line number 420shown for each line at the left side of the drawing.

Again referring to FIG. 4, the data represented in the cache 128 isdivided into slices 410 as shown. For simplification of the drawing,only four slices of the data are actually shown. Slices 3 through 6 areomitted from the drawing but follow the same pattern as the otherslices. Slice1 410A begins on line 1 of the data cache and ends near themiddle of line 5. Line 5 is shown twice at the left of the drawings.This is done for illustration so that it can be clearly seen whereslice1 410A ends and slice2 410B begins. In the cache there is actuallyonly one line of memory designated as line 5. Slice2 410B begins at theend of slice1 410A near the middle of line 5 and ends near the end ofline 9. Slice7 begins at the end of slice6 (not shown) near the middleof line 27 and ends near the end of line 31. Slice8 410D begins at theend of slice∂410C near the middle of line 31 and ends at the end of line35.

Again referring to FIG. 4, each slice of data 410 includes severalstrands of test cases. In this example, there are five strands of testcases (tc0 through tc4) divided into four segments each. The segments ofeach strand are shown with the same shading in FIG. 4. The segment ofthe strand is indicated by the number after the dash. Thus tc0-1 422 isthe first segment of test case zero, tc1-1 424 is the first segment oftest case one, tc2-1 426 is the first segment of test case 2, tc3-1 428is the first segment of test case 3 and tc4-1 430 is the first segmentof test case four. Test case zero (tc0) includes tc0-1, tc0-2, tc0-3 andtc0-4. Similarly the other test case strands include four segments. Ascan be seen using the table 412 above the data 218, each of the segmentsof test data is seven words long. It is important to note that the sevenword length of the segments means that each of the test cases are onnon-naturally aligned word boundaries. In this example this means thatthe beginning and end of each of the test case segments does not line upwith 32 byte, cache line (128 byte) and page crossing boundaries. Forexample, the page crossing boundary 432 is within the test case tc1-1 atthe boundary between line 31 and line 32 as shown in FIG. 4. Since thesegments are non-naturally aligned, after replication alignmentboundaries change for tests on subsequent segments to allow more robusttesting of the processor using the same repeated test code withdifferent slices of the data. In cases, where alignment boundaries needto be respected for a few instructions, these instructions are placed insub-segments with special alignment locations so that they preservealignment even after replication and re-execution on new segments asdescribed below.

FIG. 5 further illustrates a portion of the data in FIG. 4 havingnon-naturally aligned data boundaries. FIG. 5 illustrates the data inthe first two strands of the five strands of test cases shown in FIG. 4,namely tc0 510 and tc1 512. Test case zero (tc0) 510 includes foursegments 510A, 510B, 510C and 510D. Similarly, test case one (tc1) 512includes four segments 512A, 512B, 512C and 512D. As described above,each segment of the test cases is seven words long. The test casesegment is divided into three sub-segments. In this example, thesub-segments include a quad word, a double word and a single word for atotal of seven words. The order of the sub-segments changes for eachsegment in the test case strand in order that the test cases within thestrings can observe word boundaries where needed. The first segment 510Aof test case zero (tc0) has a quad word followed by a word and then adouble word. In the next segment of tc0 510B there is a word, a quadword and then a double word. In the next segment of tc0 510C there is adouble word, a quad word and then a single word. In the final segment oftc0 510D there is a single word, a double word and then the quad word.Similarly the tc1 alternates the single word, double word and quad wordin subsequent segments as shown in 512A, 512B, 512C and 512D.

In the example described above, each segment of the test cases has sevenwords to insure that the test case data has non-naturally aligned databoundaries . By having non-naturally aligned data boundaries for eachsegment of the slice of test data testing can be done on the replicatedtest cases to test various boundaries. These boundaries include 32 byteboundaries, cache line boundaries (128 bytes) and page crossingboundaries. The test case segment is divided into sub-segments of word,double word and quad word and the order of the sub-segments changes foreach segment in the test case strand. Dividing into sub-segments andchanging of the order of the sub-segments insures that the data for testcases within the sub-strings can observe and preserve double word andquad word boundaries where needed. Using non-naturally aligned databoundaries with replicated code insures that all types of segments willcross the boundaries at some replication of the test data. This allowstesting of the boundaries without using special code to look at therestrictions of a particular segment for each of the boundaries.

The examples described above illustrate a preferred test case segmentwith 7 words to achieve non-naturally aligned data boundaries. Othernon-naturally aligned data boundaries could include other odd numberssuch as 5, 9, 11, etc. A combination of word, double word and quad wordcould be chosen as sub-segments for these segments similar to thedescribed example. For example, for a segment with 9 words, a quad word,two double words and a word would achieve the correct number ofsub-segments for 9 words. The sub-segments could be changed for eachsegment in a strand as described above for the 7 word example.

Referring to FIG. 6, a method 500 shows one suitable example forreducing the time needed to generate test cases for testing a processorby replicating test data and placing slices of the test data into amemory cache where the slices of the replicated test data havenon-naturally aligned data boundaries. Portions of method 600 arepreferably performed by the test case generator 123 shown in FIG. 1 andthe test case executor 214 shown in FIG. 2. First, provide test datawith non-naturally aligned boundaries (step 610). Next, place multipleinstances of the test data as test data slices consecutively into memory(step 620). Run test code on the consecutive slices of data withnon-naturally aligned boundaries by branching back to rerun the testcode on the consecutive test data slices (step 630). Method 600 is thendone.

FIG. 7 shows one suitable example of a method 700 for running test codeon the consecutive slices of data with non-naturally aligned boundariesby branching back to rerun the test code on the consecutive test dataslices. Method 700 thus shows a suitable method for performing step 630in method 600. First, execute test code with one or more test cases onthe test data slice (step 710). Determine if there are additional slicesof test data (step 720). If there are additional slices (step 730=yes)then modify the base offset to point to the next test data slice (step740) and return to step 710. When there no are additional slices (step730=no) then check the results (step 750) of testing the memory cache.The method 700 is then done.

The disclosure and claims herein relate to a system for replicating testdata into a memory cache with non-naturally aligned data boundarieswhile preserving double word and quad word boundaries in segments of thereplicated test data to allow test cases to be generated for a sectionof memory and then replicated throughout the memory to reduce the timeneeded to generate test cases for testing a processor.

One skilled in the art will appreciate that many variations are possiblewithin the scope of the claims. Thus, while the disclosure isparticularly shown and described above, it will be understood by thoseskilled in the art that these and other changes in form and details maybe made therein without departing from the spirit and scope of theclaims.

1. A computer-implemented method executed by at least one processor fortesting a computer processor device comprising: providing test datacomprising a plurality of segments of test data that together make aslice of test data, wherein each segment of the plurality of segments oftest data comprise sub-segments of test data with seven words includingone single word sub-segment, one double word sub-segment and one quadword sub-segment, and wherein sub-segments in subsequent segments of thetest data are arranged in different orders; placing multiple instancesof the slice of test data in consecutive locations in a cache memory;and running a test code on the multiple instances of the slice of testdata by branching back to rerun the test code on each of the slices oftest data.
 2. The method of claim 1 wherein the step of running a testcode on the consecutive slices of test data with non-naturally alignedboundaries further comprises: executing test code with one or more testcases on a first slice of test data of the plurality of test data slicesusing a base offset; determining if there are additional slices of testdata; and where there are additional slices of test data, modifying thebase offset to point to a next test data slice and branching back toexecute the test code with the modified base offset. 3-7. (canceled) 8.The method of claim 1 wherein the slice of test data further comprises aplurality of strands of test cases that each comprise a plurality ofsegments.
 9. The method of claim 8 wherein the plurality of strandscomprises five strands with four segments in each strand with eachsegment having seven words of test data with four bytes in each word.10. A computer-implemented method executed by at least one processor fortesting a computer processor device comprising: providing test datacomprising a plurality of segments with seven words of test data thattogether make a slice of test data wherein each segment of the pluralityof segments of test data comprise sub-segments of test data with sevenwords that include one word, one double word and one quad wordsub-segment on double word and quad word boundaries and the sub-segmentsare arranged in different orders in subsequent segments of the testdata; placing multiple instances of the test data as slices of test datain consecutive locations in a cache memory; and running a test code onthe consecutive slices of test data with non-naturally alignedboundaries comprising: executing test code with one or more test caseson a first slice of test data of the plurality of slices of test datausing a base offset; determining if there are additional slices of testdata; and where there are additional slices of test data, modifying thebase offset to point to a next slice of test data and branching back toexecute the test code with the modified base offset.
 11. The method ofclaim 10 wherein the slice of test data further comprises a plurality ofstrands of test cases that each comprise a plurality of segments
 12. Themethod of claim 11 wherein the plurality of strands comprises fivestrands with four segments in each strand with each segment having sevenwords of test data with four bytes in each word. 13-21. (canceled)